/* 仪表板容器 */
.dashboard {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 25%, #2d3748 50%, #4a5568 75%, #718096 100%);
    color: #fff;
    font-family: 'Arial', sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* 背景装饰效果 */
.dashboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {

    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* 粒子效果 */
.dashboard::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.1), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: particleFloat 15s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0px);
    }

    100% {
        transform: translateY(-100px);
    }
}

/* 头部样式 */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(15, 20, 25, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-left .header-title {
    font-size: 16px;
    color: #87ceeb;
    font-weight: 500;
}

.header-center .main-title {
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(45deg, #87ceeb, #ff69b4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.user-info {
    color: #87ceeb;
}

.datetime {
    color: #fff;
}

.connection-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.connection-status.connected {
    background-color: #4caf50;
    box-shadow: 0 0 10px #4caf50;
}

.connection-status.disconnected {
    background-color: #f44336;
    box-shadow: 0 0 10px #f44336;
}

/* 主要内容区域 */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* 上半部分 */
.upper-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 单行布局 - 所有组件一行显示 */
.single-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.double-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 下半部分 */
.lower-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 组件样式 */
.widget {
    background: rgba(26, 35, 50, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.widget:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.widget h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #87ceeb;
    text-align: center;
}

/* 表格头部样式 */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    /* 增加底部间距 */
    padding: 10px 0;
    /* 增加上下内边距 */
}

.table-header h3 {
    margin: 0;
    text-align: left;
    font-size: 20px;
    /* 增加标题字体大小 */
    font-weight: bold;
}

.table-toggle {
    display: flex;
    gap: 5px;
}

.toggle-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.toggle-btn.active {
    background: linear-gradient(45deg, #87ceeb, #ff69b4);
    border-color: transparent;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.3);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    min-height: 300px;
    /* 增加最小高度 */
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-height: 280px;
    /* 表格最小高度 */
}

/* 增加表格行的高度 */
.table-container table tbody tr {
    height: 50px;
    /* 增加行高 */
}

.table-container table tbody td {
    padding: 15px 10px;
    /* 增加单元格内边距 */
    vertical-align: middle;
}

th,
td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

th {
    background: rgba(255, 255, 255, 0.1);
    color: #87ceeb;
    font-weight: 600;
    padding: 15px 10px;
    /* 增加表头内边距 */
    height: 50px;
    /* 增加表头高度 */
}

td {
    color: #fff;
}

/* 排行榜样式 */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(26, 35, 50, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: rgba(26, 35, 50, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.rank-number {
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.car-image {
    width: 60px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: #333;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.car-name {
    font-weight: bold;
    color: #87ceeb;
}

.car-brand {
    font-size: 12px;
    color: #ccc;
}

.car-price {
    font-size: 12px;
    color: #ff6b6b;
}

.car-sales,
.car-warranty,
.car-launch {
    font-size: 11px;
    color: #aaa;
}

/* 词云图样式 */
.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
    min-height: 450px;
    padding: 25px;
    background: rgba(135, 206, 235, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(135, 206, 235, 0.2);
}

.word-cloud-item {
    padding: 8px 15px;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.2), rgba(255, 105, 180, 0.2));
    border-radius: 25px;
    color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.word-cloud-item:hover {
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.4), rgba(255, 105, 180, 0.4));
    transform: scale(1.15);
    box-shadow: 0 4px 15px rgba(135, 206, 235, 0.3);
    border-color: rgba(135, 206, 235, 0.5);
}

/* 统计摘要样式 */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(26, 35, 50, 0.8);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #87ceeb;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #ccc;
}

/* 品牌排行榜样式 */
.brand-ranking {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(26, 35, 50, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.brand-item:hover {
    background: rgba(26, 35, 50, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(3px);
}

.brand-rank {
    color: #ff6b6b;
    font-weight: bold;
}

.brand-name {
    color: #fff;
    font-weight: 500;
}

.brand-categories {
    color: #87ceeb;
    font-size: 12px;
}

/* 车辆总数据内的子组件样式 */
.brand-ranking-section,
.sales-share-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-ranking-section h4,
.sales-share-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #87ceeb;
    text-align: center;
    font-weight: bold;
}

/* 品牌排行榜和油电销售占比一行布局 */
.brand-share-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-share-row .brand-ranking-section,
.brand-share-row .sales-share-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* 导出按钮样式 */
.export-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.export-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-size: 18px;
    color: #87ceeb;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .dashboard-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-right {
        flex-direction: column;
        gap: 10px;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .export-buttons {
        position: static;
        justify-content: center;
        margin-top: 20px;
    }
}

/* 滚动条样式 */
.dashboard-content::-webkit-scrollbar {
    width: 8px;
}

.dashboard-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.dashboard-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.dashboard-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}